//
//  NSArray+ROW.m
//  WHPersonalData
//
//  Created by shengmeng chen on 2021/10/23.
//  Copyright © 2021 mac. All rights reserved.
//

#import "NSArray+ROW.h"

@implementation NSArray (ROW)

+(NSArray*)changeArrayWithRowDict:(NSDictionary*)rowsDict
{
    NSArray*array;
    if ([rowsDict[@"ROW"] isKindOfClass:[NSDictionary class]])
    {
        array = @[rowsDict[@"ROW"]];
    }else if ([rowsDict[@"ROW"] isKindOfClass:[NSArray class]])
    {
        array = rowsDict[@"ROW"];
    }
    return array;
}

+(NSArray*)changeArrayWithDict:(NSDictionary*)dict withKey:(NSString*)key
{
    NSArray*array;
    if ([dict[key] isKindOfClass:[NSDictionary class]])
    {
        array = @[dict[key]];
    }else if ([dict[key] isKindOfClass:[NSArray class]])
    {
        array = dict[key];
    }
    return array;
}

@end
